#ifndef YY_SAMPLING_INCLUDE
#define YY_SAMPLING_INCLUDE


half4 DownsampleBox4Tap(sampler2D _MainTex, float2 uv, float2 texelSize)
{
	float4 d = texelSize.xyxy * float4(-1.0, -1.0, 1.0, 1.0);
	//half4 s;

	fixed4 s = tex2D(_MainTex, uv + d.xy);
	s += tex2D(_MainTex, uv + d.zy);
	s += tex2D(_MainTex, uv + d.xw);
	s += tex2D(_MainTex, uv + d.zw);

	return s * 0.25h;
}

// Standard box filtering
half4 UpsampleBox(sampler2D tex, float2 uv, float2 texelSize, float4 sampleScale)
{
	float4 d = texelSize.xyxy * float4(-1.0, -1.0, 1.0, 1.0) * (sampleScale * 0.5);

	half4 s;
	s = (tex2D(tex, uv + d.xy));
	s += (tex2D(tex, uv + d.zy));
	s += (tex2D(tex, uv + d.xw));
	s += (tex2D(tex, uv + d.zw));

	return s * 0.25h;
}



#endif